<template>
  <div class="toast-wrap-y" v-if="show">
    <transition enter-class="toast-wrap-animate" leave-active-class="toast-wrap-animate">
      <div class="toast-y-c" v-show="contentShow">
        <div :class="iconClass" v-if="iconClass" class="toast-icon"></div>
        <div>{{content}}</div>
      </div>
    </transition>
  </div>
</template>

<script>
  export default {
    props: {
      show: {
        type: Boolean,
        default: false
      },
      contentShow: {
        type: Boolean,
        default: false
      },
      iconClass: {
        type: String,
        default: ""
      },
      content: {
        type: String,
        default: ""
      }
    }
  }
</script>

<style scoped>
  .toast-wrap-y {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
  }

  .toast-wrap-animate {
    opacity: 0;
  }

  .toast-y-c {
    min-width: 56px;
    max-width: 82%;
    padding: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    transition: all .4s linear;
    -webkit-transition: all .4s linear;
    z-index: 999;
    font-size: 15px;
    text-align: center;
  }
  .toast-icon{
    font-size: 18px;
    display: block;
    padding: 2px 0;
  }

</style>
